package com.tobeface.sns.application.security;

import com.tobeface.sns.domain.User;

/**
 * 
 * @author loudyn
 * 
 */
public interface UserService {

	/**
	 * 
	 * @param username
	 * @return
	 */
	User getByUsername(String username);
	
	/**
	 * 
	 * @param email
	 * @return
	 */
	User queryUniqueByEmail(String email);

	/**
	 * 
	 * @param entity
	 */
	void save(User entity);

	/**
	 * 
	 * @param username
	 * @param email
	 */
	void forgetPassword(String username, String email);
	
	/**
	 * 
	 * @param username
	 * @param newPassword
	 */
	void updatePassword(String username, String newPassword);

	/**
	 * 
	 * @param username
	 * @param email
	 * @return
	 */
	boolean existsByUsernameAndEmail(String username, String email);

	/**
	 * 
	 * @param username
	 * @param email
	 * @return
	 */
	boolean existsByUsername(String username);
	
	void updateEmail(String username, String newEmail);

}
